<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8" import="com.java.service.*,java.util.*,com.java.model.UserSession,com.java.util.*"%>
<jsp:include page="/jsp/common/header.jsp"></jsp:include>
<%
	
	String poi_kisu_std_no 		= CmmUtil.nvl(request.getParameter("poi_kisu_std_no"),"");
	String poi_nm				= CmmUtil.nvl(request.getParameter("poi_nm"),"");
	String login_nm				= CmmUtil.nvl(request.getParameter("login_nm"),"");
	
	HashMap map = new HashMap();
	HashMap map1 = null;
	ArrayList list = new ArrayList();
	CommonDaoService commonservice = new CommonDaoService("Com0102lp02Pop02Dao");
	map.put("poi_kisu_std_no",poi_kisu_std_no);
	
	list = (ArrayList)commonservice.commonDaoMethod(map);
	
	System.out.println(list);
	
	int self_height = list.size();
	self_height = self_height * 50;
	
	if(self_height == 0){
		self_height = 200;
	}
%>
<style type="text/css">
<!--
.tablebasic {padding:0px; margin:0px; font:12px Dotum; text-decoration: none;}
.tablebasic tr{background:#ffffff;}
.title{width:15%; background:#f8f8f8; font-size:12px; color: #000000;}
.table_input {margin-top:1px; float:left; border:1px solid #7f9db9; font-size:10px;}
.table_select {font-size:11px;}
input {float:left;}
.checkbox {margin-left:2px;}
-->
</style>
<body>
<%
String ent_id="";
String test_id="";
String quest_id="";
String kisu_id="";
String poi_cd="";
String quest_no="";

String quest_type="";
String quest_title="";
String correct_yn="";
String quest_sub_1="";
String quest_sub_2="";
String quest_sub_3="";
String quest_sub_4="";
String quest_sub_5="";
String test_correct="";
String test_reply="";
String quest_explain="";
String subject_point="";
String object_point="";


if(list != null && list.size() > 0){

	for(int i=0; i<list.size(); i++){
    	map1 = (HashMap)list.get(i);
    	
    	ent_id	= CmmUtil.nvl((String)map1.get("ent_id"),"");
    	test_id	= CmmUtil.nvl((String)map1.get("test_id"),"");
    	quest_id	= CmmUtil.nvl((String)map1.get("quest_id"),"");
    	kisu_id	= CmmUtil.nvl((String)map1.get("kisu_id"),"");
    	quest_no	= CmmUtil.nvl((String)map1.get("quest_no"),"");
    	poi_kisu_std_no	= CmmUtil.nvl((String)map1.get("poi_kisu_std_no"),"");
    	quest_type	= CmmUtil.nvl((String)map1.get("quest_type"),"");
    	quest_title	= CmmUtil.nvl((String)map1.get("quest_title"),"");
    	correct_yn	= CmmUtil.nvl((String)map1.get("correct_yn"),"");
    	quest_sub_1	= CmmUtil.nvl((String)map1.get("quest_sub_1"),"");
    	quest_sub_2	= CmmUtil.nvl((String)map1.get("quest_sub_2"),"");
    	quest_sub_3	= CmmUtil.nvl((String)map1.get("quest_sub_3"),"");
    	quest_sub_4	= CmmUtil.nvl((String)map1.get("quest_sub_4"),"");
    	quest_sub_5	= CmmUtil.nvl((String)map1.get("quest_sub_5"),"");
    	test_correct	= CmmUtil.nvl((String)map1.get("test_correct"),"");
    	test_reply	= CmmUtil.nvl((String)map1.get("test_reply"),"");
    	quest_explain	= CmmUtil.nvl((String)map1.get("quest_explain"),"");
    	subject_point	= CmmUtil.nvl((String)map1.get("subject_point"),"");
    	object_point	= CmmUtil.nvl((String)map1.get("object_point"),"");
    	poi_cd	= CmmUtil.nvl((String)map1.get("poi_cd"),"");
    	
    	
    	if(!quest_type.equals("1")){
%>		
				<table class='tablebasic' width='600' border='0' >
					<tr>
					<td colspan='4'><%=quest_no %>. <%=quest_title%>
                     <font color=red>  (배점:<%=object_point%>)</font></td>
					</tr>
<%if(!quest_sub_1.equals("")){ %>				
					<tr id='show_quest_sub_1_<%=i%>'>
					<td colspan='4'><input type ='radio' id='quest_sub_1_<%=i%>' name='quest_sub<%=i%>' value='1' disabled <%=(test_reply.equals("1"))?"checked":"" %>><%=quest_sub_1%></td>
					</tr>
<%} %>
<%if(!quest_sub_2.equals("")){ %>	
					<tr id='show_quest_sub_2_<%=i%>'>
					<td colspan='4'><input type ='radio' id='quest_sub_2_<%=i%>' name='quest_sub<%=i%>' value='2' disabled <%=(test_reply.equals("2"))?"checked":"" %>><%=quest_sub_2%></td>
					</tr>
<%} %>
<%if(!quest_sub_3.equals("")){ %>	
					<tr id='show_quest_sub_3_<%=i%>'>
					<td colspan='4'><input type ='radio' id='quest_sub_3_<%=i%>' name='quest_sub<%=i%>' value='3' disabled <%=(test_reply.equals("3"))?"checked":"" %>><%=quest_sub_3%></td>
					</tr>
<%} %>
<%if(!quest_sub_4.equals("")){ %>	
					<tr id='show_quest_sub_4_<%=i%>'>
					<td colspan='4'><input type ='radio' id='quest_sub_4_<%=i%>' name='quest_sub<%=i%>' value='4' disabled <%=(test_reply.equals("4"))?"checked":"" %>><%=quest_sub_4%></td>
					</tr>
<%} %>
<%if(!quest_sub_5.equals("")){ %>	
					<tr id='show_quest_sub_5_<%=i%>'>
					<td colspan='4'><input type ='radio' id='quest_sub_5_<%=i%>' name='quest_sub<%=i%>' value='5' disabled <%=(test_reply.equals("5"))?"checked":"" %>><%=quest_sub_5%></td>
					</tr>
<%} %>
					<tr>
					<td height='20' colspan='4'></td>
					</tr>  		 			
					<tr>
					<td width='100' align='center'>문제정답</td><td width='100'><%=test_correct%></td>
					<td width='100' id ='correct_yn' >정답여부</td><td align='left' width='500'><%=correct_yn%></td>
					</tr>  		 			
		            <tr>
		            <td width='100' align='center'>문제해설</td><td colspan='3' width='700'><%=quest_explain%></td>
		    		</tr>
		    		<tr>
		    		<td width='100' align='center'>점수</td><td colspan='3' width='700'><input type='text' id='object_point' name='object_point' readonly value=<%=object_point%>></td>
		    		</tr>
					<tr>
					<td height='20' colspan='5'></td>
					</tr>  		 			
		    	</table>
<%
   		}else {
%>		    		
		    	 <br>
				<table class='tablebasic' width='600' border='0' frame='box'>
					<tr>
					<td colspan='2'><%=quest_no%>. <%=quest_title%>
                     <font color=red>  (배점:<%=subject_point%>)</font></td>
					</tr>
					<tr>
					<td width='100' align='center'>학습자</br>답변</td><td><%=test_reply%></td>
					</tr>  		 			
		            <tr>
					<td width='100' align='center'>정답</td><td><%=test_correct%></td>
					</tr>  		 			
		            <tr>
					<td width='100' align='center'>문제</br>해설</td><td><%=quest_explain%></td>
					</tr>  		 			
		            <tr>           
		    		<td width='100' align='center'>점수</td><td><input type='text' name='subject_point' value=<%=subject_point%>></td>
		    		</tr>
		    	</table>
		    	<input type='hidden' name='sStatus' value='U'>
		    	<input type='hidden' name='quest_id' value='<%=quest_id%>'>
		    	 <input type='hidden' name='test_id' value='<%=test_id%>'>;
		    	
<%    	
		}
	}
}
%>
</body>
</html>